package leetcode.code1678;

import leetcode.IDebug;

public class Solution implements IDebug {

	public String interpret(String command) {
		// "G()(al)"
		StringBuffer ans = new StringBuffer();
		char[] cs = command.toCharArray();
		int p = 0;
		while (p < cs.length) {
			char cur = cs[p];
			if (cur == 'G') {
				ans.append('G');
				p++;
			} else if (cur == '(') {
				if (cs[p + 1] == ')') {
					ans.append('o');
					p += 2;
				} else {
					ans.append("al");
					p += 4;
				}
			}
		}
		return ans.toString();
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
